﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightClient
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            Proxy.ServiceContractBaseClient service = new Proxy.ServiceContractBaseClient();
            service.GetDataCompleted+=new EventHandler<Proxy.GetDataCompletedEventArgs>(service_GetDataCompleted);
            Proxy.Criteria criteria = new Proxy.Criteria();
            Dictionary<string, object> parameters = new Dictionary<string, object>();
            parameters.Add("value", 7);
            //parameters.Add("name", "Eldhose");

            criteria.Parameters = parameters;
            criteria.Entity = "DataServiceFacade";
            criteria.Method = "SayHello";
            service.GetDataAsync(criteria);
        }

        private void service_GetDataCompleted(object sender, Proxy.GetDataCompletedEventArgs e)
        {
            MessageBox.Show(e.Result.ToString());
        }

    }
}
